{% extends "base.html" %}
{% block head %}
<style  type="text/css">
  .detail a:link{text-decoration:none;}
  .detail a:link {color: #008000}
  .detail a:visited {color: #C0C0C0}
  .detail a:hover {color: #FF00FF}
  .detail a:active {color: #0000FF}
</style>

{% endblock head %}

{% block tittle %}
result
{% endblock tittle %}

{% block content %}
<div style="padding:50px;width:1024px;">
<div align="center">
  <a href="/"><img width="270" height="130" src="/static/images/logo_big.jpg" /></a>
</div>
{% include "form_search.html" %}
<hr />

{% if error %}
    <p style="color: blue;">请先输入查询条件！</p>
{% else %}

<p>搜索关键词: <strong>{{ query }}</strong></p>

{% ifequal total_num 0 %}
<p>没有找到与 "{{ query }}" 相关的信息！</p>

{% else %}
<p style="color: blue;">符合搜索条件"{{query}}"的结果共有 {{ total_num }} 条, 显示前 {{ show_num }} 条:</p>
<hr />
<br />

{% for item in result.object_list %}

<div class="highlightarea" style="width: 950px;">
<a class="highlightLink" href="{{ item.url }}" target="_blank"> {{ item.title }} </a>&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#342D7E;">--score:&nbsp;{{ item.score }}</span><br />
<div>
<span class=detail style="font-size:12px;"><br />详情点击: <a href="{{ item.url }}" target="_blank"> {{ item.url }} </a>
</span>
<br /><br />
</div>
</div>

{% endfor %} 


<p class="paginator">
  {% if result.has_previous %}
  <a href="?q={{query}}&page={{result.previous_page_number}}">
    &lt; 上一页</a>
  {% endif %}
  <span>
    {% for p in page_range %}
    {% ifequal p result.number %}
    <span class="this-page">{{p}}</span>
    {% else %}
    <a href="?q={{query}}&page={{p}}" 
       title="第{{p}}页">{{p}}</a>
    {% endifequal %}
    {% endfor %}
  </span>
  {% if result.has_next %}
  <a href="?q={{query}}&page={{result.next_page_number}}">
    下一页 &gt; </a>
  {% endif %}
  <a >[第{{ result.number }}/{{ result.paginator.num_pages }}页]</a>
</p>

{% endifequal %}

{% endif %}
</div>
{% endblock content %}
